// pages/home/repair/monitoring/monitoring.js
function getRandomColor() {
    const rgb = []
    for (let i = 0; i < 3; ++i) {
      let color = Math.floor(Math.random() * 256).toString(16)
      color = color.length === 1 ? '0' + color : color
      rgb.push(color)
    }
    return '#' + rgb.join('')
  }
Page({
  /**
   * 页面的初始数据
   */
  data: {
    video_data: {}, //要播放的视频对象
    fullScreen: false, //视频是否全屏
    recommendListArr: [],
    eventList:[{
        id:1,
        time:"20:16:04",
        type:0,
        title:"画面变动",
        titleIcon:"http://39.107.110.103:9000/property-management/images/home/jk/bian.png",
        infoIcon:"http://39.107.110.103:9000/property-management/images/home/jk/success.png"
    },
    {
        id:2,
        time:"20:16:04",
        type:0,
        title:"有人移动",
        titleIcon:"http://39.107.110.103:9000/property-management/images/home/jk/run.png",
        infoIcon:"http://39.107.110.103:9000/property-management/images/home/jk/warning.png"
    },
    {
        id:3,
        time:"20:16:04",
        type:0,
        title:"画面变动",
        titleIcon:"http://39.107.110.103:9000/property-management/images/home/jk/bian.png",
        infoIcon:"http://39.107.110.103:9000/property-management/images/home/jk/danger.png"
    },
    {
        id:4,
        time:"20:16:04",
        type:0,
        title:"画面变动",
        titleIcon:"http://39.107.110.103:9000/property-management/images/home/jk/bian.png",
        infoIcon:"http://39.107.110.103:9000/property-management/images/home/jk/danger.png"
    },
    {
        id:5,
        time:"20:16:04",
        type:0,
        title:"画面变动",
        titleIcon:"http://39.107.110.103:9000/property-management/images/home/jk/bian.png",
        infoIcon:"http://39.107.110.103:9000/property-management/images/home/jk/danger.png"
    }
]
  },
  

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  videoPlay(){
      debugger
    this.videoContext.play()
  },

  videoPause() {
    this.videoContext.pause()
  },

  videoPlayBackRate() {
    this.videoContext.playbackRate(1.5)
  },

  videorequestFullScreen() {
    this.videoContext.requestFullScreen()
  },

  videoSeek0() {
    this.videoContext.seek(0)
  },

  bindInputBlur: function (e) {
    this.inputValue = e.detail.value
  },
  
  bindSendDanmu: function () {
    this.videoContext.sendDanmu({
      text: this.inputValue,
      color:"#FFFFF"
    })
  },
  onReady: function () {
    this.videoContext = wx.createVideoContext('Video')
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})